package io.gitee.wminyu.day02;

import org.jetbrains.annotations.Contract;

import java.util.Arrays;
import java.util.Scanner;

public class arraySort {
    public static void main(String[] args){
        int m;
        Scanner input = new Scanner(System.in);
        m = input.nextInt();
        int arrys1[] = new int [m];
        for (int i=0; i< m ;i++){
            arrys1[i] = input.nextInt();
        }
        System.out.println(isSorted(arrys1));
    }
    public static boolean isSorted(int[] numbers) {
        for (int i = 0; i < numbers.length-1; i++) {
            if (numbers[i] > numbers[i + 1]) {
                return false;
            }
        }
        return true;
    }
}
